{include file="common/header.tpl"}

<script language="javascript">
{literal}
	function resizeClick()
	{
		if($('resize').checked)
		{
			$('w').disabled = '';
			$('h').disabled = '';
		}
		else
		{
			$('w').disabled = 'disabled';
			$('h').disabled = 'disabled';
		}
	}
{/literal}
</script>
<body>
{assign var="upload" value="current"}
{include file="common/toptab.tpl"}
<div id="tabs4">
</div>
<div id="option_response" class="wrap ajaxResponse"></div>

<!-- Build the page here -->
<div class="wrap" style="min-height: 400px">
<table width="100%" height="100%" cellpadding="0" cellspacing="0">
	<tr>
	<td width="54px" height="43px" class="fr_lefttop"></td>
	<td height="43px" class="fr_centertop" ></td>
	<td width="48px" height="43px" class="fr_righttop"></td>
	</tr>
	<tr>
	<td width="54px" class="fr_leftmiddle" >&nbsp;</td>
<td class="fr_centermiddle">
{if $message != null}
	<div id="ajaxResponse1" class="ajaxResponse fade" style="display:block">{$message}</div>
{/if}
<h2>{t}Upload{/t}</h2>
{if $smarty.session.u_isadmin == "1"}
 <form enctype="multipart/form-data" action="" method="POST">
    <input type="hidden" name="uploadfile" value="upload" />
    {t}Send this file:{/t} <input size="100" name="userfile" type="file" />
   
    <p class="submit" align = "right">
    <input type="submit" value="{t}Upload Selected File{/t}" />
    </p>
</form>
<br /> 
<form name="review" id="review" method="post" action="?mod=upload">
	<input type="hidden" name="changeShowImg" value="changeShowImg">
	<label for="showImg">
	<input {if $smarty.session.showImg == "1"} checked {/if} id="showImg" name="showImg" type="checkbox" onClick="review.submit()" value="1"/>
	{t}Show image{/t}</label>
</form>
<table class="widefat">
		<thead>
		<tr>
	        <th scope="col">{t}Name{/t}</th>
	        <th scope="col">{t}Path{/t}</th>
	        <th scope="col" style="text-align:center">{t}For Download{/t}</th>
	        <th scope="col" style="text-align: center">{t}Action{/t}</th>
		</tr>
		</thead>
		<tbody id="table">
		{foreach name=cat from=$FILES item=item}
			<tr id="" class="{cycle values=,alternate}">
				<th scope='row'>
				{if $item.image == "1" && $smarty.session.showImg == "1"}
					<img src="../upload/files/{$item.name}" width="64" height="64" /><br />
				{else}
					{$item.name}
				{/if}
				</th>
				<td>{$item.link}</td>
				<td style="text-align:center">{if $item.type!=''}x{/if}</td>
				<td style="text-align: center">
				<a href="?mod=upload&del={if $item.type!=''}{$item.type}/{/if}{$item.name}" class='delete'>{t}Delete{/t}</a>
				</td>
			</tr>
		{/foreach}
		</tbody>
</table>
{/if}
</td>
<td width="48px" class="fr_rightmiddle"></td>
	</tr>
	<tr>
	<td width="54px" height="60px" class="fr_leftbot" ></td>
	<td height="60px" class="fr_centerbot"></td>
	<td width="48px" height="60px" class="fr_rightbot" ></td>
	</tr>
</table>
</div>
</body>